<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>{$name}管理</strong></div>
        <div class="padding border-bottom">
            <a href="JavaScript:void(0);" class="button button-small bg-green">管理</a>
            <a href="{:U('add',array('tp'=>$tp))}" class="button button-small border-green">添加</a>
        </div>

        <form method="post" action="" name="myForm" id="myForm">
            <table class="table tb-type2 nobdb">
                <thead>
                    <tr class="thead">
                        <th width="5%">编号</th>
                        <th>秒杀名称</th>
                        <th width="10%">数量</th>
                        <th width="10%">单价</th>
                        <th width="12%">开始时间</th>
                        <th width="12%">结束时间</th>
                        <th width="7%">运行状态</th>
                        <th width="7%">审核状态</th>
                        <th width="15%">操作</th>
                    </tr>
                </thead>
                <tbody>
                <notempty name="seckill">
                <foreach item="v" name="seckill">
                    <tr class="hover" style="background: rgb(255, 255, 255);">
                        <td>{$v['seckill_id']}</td>
                        <td><a href="{:HOME_URL}/Goods/{$v['seckill_goods_id']}" target="_blank">{$v['seckill_title']}</a></td>
                        <td>{$v['seckill_nums']}</td>
                        <td>{$v['seckill_price']}</td>
                        <td>{$v['seckill_start_time']|date='Y-m-d H:i',###}</td>
                        <td>{$v['seckill_end_time']|date='Y-m-d H:i',###}</td>
                        <td class="nowrap align-center">
                        <if condition="$v['seckill_state'] eq 1">
                            <a class="button bg-green button-little"><i class="icon-check-square"></i>运行中</a>
                            <else />
                            <a class="button bg-gray button-little"><i class="icon-trash"></i>已结束</a>
                        </if>
                        </td>
                        <td class="nowrap align-center">
                        <if condition="$v['seckill_qx'] eq 1">
                            <a class="button bg-green button-little" href="javascript:(0)" title="已审核/点击取消" onclick="tuijian({$v['seckill_id']},'已审核，确认取消此审核吗？')"><i class="icon-thumbs-up"></i>已审核</a>
                            <else />
                            <a class="button bg-gray button-little" href="javascript:(0)" title="未审核/点击审核通过" onclick="tuijian({$v['seckill_id']},'未审核，确认通过审核吗？')"><i class="icon-thumbs-down"></i>未审核</a>
                        </if>
                        </td>
                    <td class="w144 align-center">
                        <a class="button bg-green button-little" href="{:U('edit',array('seckill_id'=>$v['seckill_id']))}"><i class="icon-eye"></i>预览</a>
                        <a class="button bg-blue button-little" href="{:U('edit',array('seckill_id'=>$v['seckill_id'],'tp'=>$tp))}"><i class="icon-edit"></i>编辑</a>
                        <a class="button bg-red button-little js-del" href="javascript:;" data="{$v['seckill_id']}" title="删除"><i class="icon-minus-circle"></i>删除</a>
                    </td>
                    </tr>
                </foreach>
                <else />
                    <tr class="tfoot">
                        <td colspan="9">暂无数据</td>
                    </tr>
                </notempty>
                </tbody>
                <tfoot>
                    <tr class="tfoot">
                        <td colspan="15"><div class="pages clearfix" >{$page}</div></td>
                    </tr>
                </tfoot>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    $('#myForm').layer({
        actionUrl: "batchAction",
        deleteUrl: "{:U('del')}"
    });
    
    function tuijian(dete,title){
    layer.confirm(title,
    {btn: ['是的', '算了'] },function(){
            dete = {seckill_id:dete};
            var p = Aajax("{:ADMIN_URL}{:U('Seckill/del_tuijian')}", dete);
            if (p.n){
                layer.msg('操作成功');
                setTimeout("history.go(0)", 1000);
            } else{
                layer.msg('出错请稍后再试');
            }
        }
    );
    }
    
</script>